import _ from "lodash";
var ElTabPane = {
  cmpnt: "ElTabPane",
  props: {
    label: "新标签01",
    name: "tab",
  },
  style: {
    minHeight: "100px",
  },
  children: [],
  _ctl: {
    name: "ElTabPane",
    text: "标签项",
    cantDrop: true,
  },
};

let p1 = _.cloneDeep(ElTabPane);
p1.props.name = _.uniqueId("tab");
let p2 = _.cloneDeep(ElTabPane);
p2.props.name = _.uniqueId("tab");

var Tabs = {
  cmpnt: "ElTabs",
  props: {
    model: p1.props.name,
    "tab-position": "top",
    closable: false,
    addable: false,
    editable: false,
    stretch: false,
  },
  style: {
    height: "200px",
  },
  push: function (ele) {
    let that = this;
    this.children.forEach((child) => {
      if (child.props.name != that.props.model) {
        return;
      }
      child.children.push(ele);
    });
  },
  children: [p1, p2],
  _ctl: {
    icon: "iconfont te-i-tabs",
    name: "Tabs",
    text: "标签",
    cantDrop: true,
  },
};
export { Tabs };
